package io.renren.modules.powercut.controller;

import java.util.Arrays;
import java.util.Map;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import io.renren.modules.powercut.entity.RepeatruleEntity;
import io.renren.modules.powercut.service.RepeatruleService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;



/**
 * 重复停电规则
 *
 * @author zhujinbo 1724282894@qq.com
 * @email 1724282894@qq.com
 * @date 2020-12-05 11:22:28
 */
@RestController
@RequestMapping("powercut/repeatrule")
@Api("重复停电规则")
public class RepeatruleController {
    @Autowired
    private RepeatruleService repeatruleService;

    /**
     * 信息
     */
    @GetMapping("/info")
    //@RequiresPermissions("powercut:repeatrule:info")
    @ApiOperation("重复停电信息")
    public R info(){
		RepeatruleEntity repeatrule = repeatruleService.getById("1335447412768026626");
        return R.ok().put("repeatrule", repeatrule);
    }


    /**
     * 修改
     */
    @PostMapping("/update")
    //@RequiresPermissions("powercut:repeatrule:update")
    @ApiOperation("重复停电规则")
    public R update(@RequestBody RepeatruleEntity repeatrule){
        repeatrule.setId("1335447412768026626");
		repeatruleService.updateById(repeatrule);

        return R.ok();
    }

}
